/*
 * @Overview:   common
 * @Author:     Zi_Jun
 * @Email:      zijun2030@163.com
 * @Date:       2020/12/8 11:21
 * @Mark:       //
 */
import { isObject } from './validate';

export const deepMerge = (src: any, target: any): any => {
  let key: string;
  for (key in target) {
    if (target.hasOwnProperty(key)) {
      src[key] = isObject(src[key]) ? deepMerge(src[key], target[key]) : (src[key] = target[key]);
    }
  }
  return src;
};
